import request from '@/utils/request'
import processRichText from "@/utils/processRichText"
import {
	ref,
} from 'vue'

export default () => {
	const config = ref({
		introduce:'',
		logo:"",
		phone:"",
		wechat:"",
		address:"",
		coordinates:{
			latitude:0,
			longitude:0
		}
	})

	const getConfig = async () => {
		let data  = await request.get(`mini/config`)
		data.introduce = processRichText(data.introduce)
		config.value=data
	}
	return {
		config,
		getConfig
	}
}